package indi.zhifa.engine.test.busylogic.test.service.impl;

import com.alibaba.fastjson2.JSON;
import indi.zhifa.core.auth.util.ITokenUtil;
import indi.zhifa.engine.test.busylogic.test.entity.TestWhoImIResponse;
import indi.zhifa.engine.test.busylogic.test.service.IWhoImIService;
import indi.zhifa.engine.test.properties.AppProperties;
import indi.zhifa.engine.test.token.AuthObject;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Base64;

@RequiredArgsConstructor
@Component
public class WhoImIServiceImpl implements IWhoImIService {

    private final AppProperties mAppProperties;
    private final ITokenUtil mTokenUtil;

    @Override
    public TestWhoImIResponse whoImI() {
        TestWhoImIResponse testWhoImIResponse = new TestWhoImIResponse();
        testWhoImIResponse.setServName(mAppProperties.getServName());
        AuthObject authObject = mTokenUtil.getAuthObject();
        testWhoImIResponse.setAuthObject(authObject);
        return testWhoImIResponse;
    }
}
